<template>
  <div>
    <component-head title='添加联系人'></component-head>
    <div class="content">
      <!-- 联系人编辑 -->
      <van-address-edit
        :area-list="lists"
        show-postal
        show-set-default
        :area-columns-placeholder="['请选择', '请选择', '请选择']"
        @save="onSave"
      />
    </div>
    
  </div>
</template>

<script>
import componentHead from '@/views/car/components/component'
import {  mapState, mapMutations } from 'vuex'
import { Toast } from 'vant'
export default {
  components: {
    componentHead
  },
  methods: {
    onSave (info) {
      this.savecontact(info)
      Toast("添加成功")
    },
    ...mapMutations('addcontact', ['savecontact'])
  },
  computed: {
    ...mapState({
      infos: (state) => state.addcontact.contact
    }),
    ...mapState({
      lists: (state) => state.addcontact.areaList
    })
  }
}
</script>

<style lang="scss" scoped>
  .content{
    margin-top: 46px;
  }
</style>
